package com.example.test13spring.config;

import com.example.test13spring.bean.Student;
import com.example.test13spring.bean.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Author: fxy
 * @Date: 2022/04/14/17:20
 * @Description:
 */
@Configuration
public class MyConfig {
    @Bean("student")
    public Student getStudent(){
        return new Student();
    }

    @Bean
    public User getUser(){
        User user = new User();
        user.setStudent(getStudent());
        return user;
    }
}
